package com.example.service.impl;

import java.util.Arrays;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.example.dao.CategoryDao;
import com.example.model.Category;
import com.example.model.query.CategoryExample;
import com.example.service.CategoryService;


/**
 * Created on 2017/12/26 18:50
 */
@Service
public class CategoryServiceImpl implements CategoryService {

    @Autowired
	private CategoryDao categoryDao;

    @Transactional(readOnly = true)
    public Category selectByPrimaryKey(Byte id) {
        return categoryDao.selectByPrimaryKey(id);
    }

	@Transactional(readOnly = true)
	public List<Category> selectByExample(CategoryExample q) {
		return categoryDao.selectByExample(q);
	}

	@Transactional
	public Object insert(Category t) {
		return categoryDao.insert(t);
	}

	@Transactional
	public Object insertSelective(Category t) {
		return categoryDao.insertSelective(t);
	}

	@Transactional
	public Object updateByPrimaryKeySelective(Category t) {
		return categoryDao.updateByPrimaryKeySelective(t);
	}

	@Transactional
	public Object updateByExampleSelective(Category t, CategoryExample q) {
		return categoryDao.updateByExampleSelective(t, q);
	}

	@Transactional
	public Object updateByExample(Category t, CategoryExample q) {
		return categoryDao.updateByExample(t, q);
	}

    @Transactional
    public Object updateByPrimaryKey(Category t) {
        return categoryDao.updateByPrimaryKey(t);
    }

	@Transactional(readOnly = true)
	public Long countByExample(CategoryExample q) {
		return categoryDao.countByExample(q);
	}

    @Transactional
    public Integer deleteByPrimaryKey(Byte id) {
        return categoryDao.deleteByPrimaryKey(id);
    }



	@Transactional
	public Integer deleteByExample(CategoryExample q) {
		return categoryDao.deleteByExample(q);
	}

}
